<template>
	<view>
		<qq-image v-if="get_url()" class="bg-img" :url="get_url()" :style="{height: height}" mode="aspectFill"></qq-image>
	</view>
</template>

<script>
	export default {
		name: "bg-img",
		data() {
			return {
				height:getApp().globalData.screenHeight+'px'
			};
		},
		props: {

			id: {
				type: String,
				default: ''
			},
			info: {
				type: [Object, String],
				default: ()=>{}
			}
		},
		methods: {
			get_url() {
				let url = ''
				if (this.info) {
					url = this.info?.mine?.chatBackclothUrl
				} else {
					let user = this.chat_friends.filter(val => val.id == this.id)[0];
					url = user?.relUserFriendGroup?.chatBackclothUrl || ''
				}
				return url == '001' ? '' : url

			}
		}

	}
</script>

<style lang="scss">
	.bg-img {
		width: 100vw;
		// height: 100vh;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 0;
	}
</style>
